﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/AdminMaster.Master" AutoEventWireup="true" CodeBehind="imgSlideManager.aspx.cs" Inherits="ShowRoom.admin.imgSlideManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="width:100%;text-align:center;color:#C794BA;font-weight:bold;margin-bottom:10px;padding-top:15px;"><asp:Label ID="lblTil" runat="server" Text="QUẢN LÝ HÌNH ẢNH SLIDE"></asp:Label></div>
 <div>
 <table id="tblMaster" runat="server" bordercolor="#E1E1E1"  border="0" cellpadding="0" cellspacing="0" width="100%"
 style="border-collapse: collapse;">    
     <tr>
         <td align="right">  
           <div>
                 <asp:HyperLink CssClass="HyperLink" ID="hplLogo" runat="server" NavigateUrl='#'>Thêm mới hình </asp:HyperLink>
           </div>
         </td>
     </tr>
     <tr>
        <td>
            <asp:GridView ID="gvSlide" runat="server" Width="100%" BorderWidth="1px" 
            BorderColor="#CCCCCC" AutoGenerateColumns="false" DataKeyNames="img_id" onrowdatabound="gvSlide_RowDataBound">
            <HeaderStyle BackColor="#E1E1E1" BorderWidth="1px" BorderColor="#CCCCCC" Height="33px" Font-Bold="True" ForeColor="black" />
            <EditRowStyle BorderColor="Silver" BorderWidth="1px" Height="25px" />
            <AlternatingRowStyle BorderColor="" BorderWidth="1px"/>
            <RowStyle BorderColor="#E1E1E1" BorderWidth="1px" Height="25px" BackColor="white" />
            <EmptyDataRowStyle BorderColor="Silver" BorderWidth="1px" />
            <PagerStyle BorderStyle="None"></PagerStyle>
            <PagerSettings Visible="false" />
                <Columns>
                     <asp:TemplateField HeaderText="stt" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1" ItemStyle-HorizontalAlign="center" ItemStyle-Width="7%" HeaderStyle-Width="7%">
                        <ItemTemplate>
                            <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>                           
                    </asp:TemplateField>                                                
                     <asp:TemplateField HeaderText="Tên SP" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1" ItemStyle-HorizontalAlign="Center"> 
                         <ItemTemplate>                                         
                             <asp:Label ID="lbltensp" runat="server" Text='<%# Bind("img_name") %>' ></asp:Label>                                              
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Liên kết" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1" ItemStyle-HorizontalAlign="Center"> 
                         <ItemTemplate>                                         
                             <asp:Label ID="lbllink_web" runat="server" Text='<%# Bind("link_web") %>' ></asp:Label>                                              
                        </ItemTemplate>
                    </asp:TemplateField>
                   <asp:TemplateField HeaderText="Active" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1" ItemStyle-HorizontalAlign="Center"> 
                         <ItemTemplate>                                         
                             <asp:Label ID="lblactive" runat="server" Text='<%# Bind("active") %>' ></asp:Label>                                              
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày thêm" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1" ItemStyle-HorizontalAlign="Center"> 
                         <ItemTemplate >                                         
                             <asp:Label ID="lbldateadd" runat="server" Text='<%# Bind("add_date") %>' ></asp:Label>                                              
                        </ItemTemplate>
                    </asp:TemplateField>                                           
                     <asp:TemplateField HeaderText="Hình" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1">   
                           <ItemTemplate>
                            <a  href= "#" onmouseover="showtip('<h3><%#DataBinder.Eval(Container.DataItem,"img_name") %></h3><img  src=<%#"../../../Pub/Images/ImgSlide/" + Eval("picture")%> width=180px height=200px />')" onmouseout='hidetip();' style={cursor:hand} >
					            <asp:Image ID="imgPicture" runat="server" ImageUrl='<%#"../pub/images/imgSlide/"+Eval("picture") %>'
                                       ToolTip='<%#Eval("picture")%>' Style="width: 20px; height: 20px"
                                       ImageAlign="Left" />
				            </a> <asp:Label ID="lblImage_Icon_Master" runat="server" Text='<%#Eval("picture")%>' Visible="false"></asp:Label>
                          </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Quản lý" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#E1E1E1" ItemStyle-Wrap="false" HeaderStyle-Wrap="false" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
                          <ItemTemplate>                                                
                             <asp:Image ID="imgEdit" CssClass="Cursor" runat="server" ImageUrl="img/modify.gif" /> 
                              <asp:Image ID="imgDelete" CssClass="Cursor" runat="server" ImageUrl="img/delete.gif" />     
                             <asp:Literal ID="litView" runat="server" Text="</td></tr><tr style='display:none'><td colspan='5' align='center'>"></asp:Literal>                                                                                          
                         </ItemTemplate>             
                     </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
     </tr>
 </table>
 </div>
 <input id="txtDeleteImgSlide" type="hidden" name="txtDeleteImgSlide" runat="server" />
  <script type="text/javascript">
      function OpenAddNewImg() {
          window.open("AddImgSlide.aspx?Type=Insert", null, 'status=no, toolbar=no,width=900px,height=600px,Left=100px,Top=150px');
      }
      function OpenNewEditImg(img_id) {
          window.open("AddImgSlide.aspx?Type=Edit&img_id=" + img_id, null, 'status=no, toolbar=no,width=900px,height=600px,Left=100px,Top=150px');
      }
      //xóa sản phẩm
      function CheckDeleteImgSlide(img_id) {
          var result = confirm("Bạn có muốn xóa logo này ? ");
          if (result == true) {
              var txt = document.getElementById("<%=txtDeleteImgSlide.ClientID%>");
              txt.value = "";
              txt.value = img_id;
              form1.submit();
          }
          else {
              return false;
          }
      }
    </script>

</asp:Content>
